package com.ithanwen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ithanwen.pojo.Emp;
import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

public interface EmpMapper extends BaseMapper<Emp> {
    //旧的分页查询操作
    // @Select(" select count(*) from emp e left join dept d on e.dept_id = d.id")
    // public Long count();
    //
    // @Select(" select e.*, d.name deptName  from emp e left join dept d on e.dept_id = d.id"+
    //         " order by e.update_time desc limit #{start} ,#{pageSize}")
    // public List<Emp> list(Integer start, Integer pageSize);

    // @Select(" select e.*, d.name deptName  from emp e left join dept d on e.dept_id = d.id"+
    //         " order by e.update_time desc")
    // public List<Emp> list();

    // @Select(" select e.*,d.name deptName from emp e left JOIN dept d on e.dept_id = d.id"+
    //         " WHERE e.name like concat('%',#{name},'%') and e.gender = #{gender} and entry_date between #{begin} and #{end} order by update_time desc")
    public List<Emp> search(String name, Integer gender, LocalDate begin,LocalDate end);

    public List<Map<String,Object>> countEmpJobOption();

    List<Map<String, Integer>> countEmpGenderOption();
}
